package com.link.base.base.mpconfig.service;

import com.link.base.base.mpconfig.dao.mybatis.mapper.MpInnerMenuMapper;
import com.link.base.base.mpconfig.model.MpInnerMenu;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 小程序菜单配置
 *
 * @author: 闫有霞
 * @date: 2019/12/19
 */
@Service
public class MpInnerMenuServiceImpl extends BasicServiceImpl<MpInnerMenu> implements MpInnerMenuService {

    @Resource
    private MpInnerMenuMapper mpInnerMenuMapper;
    
    @Override
    public BasicMapper<MpInnerMenu> getBasicMapper() {
        return mpInnerMenuMapper;
    }

    /**
     * @createdBy 闫有霞
     * @date 2018/12/18
     * @methods: deleteByMpId
     * @param: MpInnerMenu mpInnerMenu
     * @return: void
     * @description: 根据小程序ID删除数据
     **/
    @Override
    public void deleteByMpId(MpInnerMenu mpInnerMenu) throws Exception {
        List<MpInnerMenu> mpMenuList = mpInnerMenuMapper.queryAll(mpInnerMenu);
        if (mpMenuList != null && mpMenuList.size() != 0) {
            for (MpInnerMenu item : mpMenuList) {
                mpInnerMenuMapper.deleteById(item);
            }
        }
    }


}

